package Java中调用Scala方法


/**
 * @author JuntaoZhang
 * @since 12/3/15 5:34 PM
 */
case class Stu(name: String)

import scala.language.implicitConversions
import scala.reflect.ClassTag

class ScalaFunctions {
  def test1(f: Function[Stu, String]): String = {
    import scala.language.implicitConversions

    def fn: (Stu) => String = (x: Stu) => f.call(x)
    test(fn)
  }

  def fakeClassTag[T]: ClassTag[T] = ClassTag.AnyRef.asInstanceOf[ClassTag[T]]

  def test(mapFunc: Stu => String): String = {
    mapFunc(Stu("hans"))
  }
}
